package com.halko.PR.controller;

import com.halko.PR.dto.LoginDTO;
import com.halko.PR.pojo.Result;
import com.halko.PR.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author halko
 * @create 2021-04-08 15:53
 */
@RestController
public class LoginController {

    @Autowired
    LoginService loginService;

    @PostMapping(value = "/api/login")
    @CrossOrigin       //后端跨域
    public Result login(@RequestBody LoginDTO loginDTO){
        return loginService.login(loginDTO);
    }

}
